$(document)
		.ready(
				function() {

					$
							.ajax({
								type : "post",
								url : "busList",
								async : true,
								dataType : 'json',
								success : function(data) {
									
									console.log(data)
									var articlePath = 'myAssets//img//article//';// 文章文件路径
									var facePath = 'myAssets//img//face//';// 头像文件路径
									
									var list = data.list;// 文章数组
									for (var i = 0; i < list.length; i++) {
										var id = list[i].id;
										var type = list[i].type;// 类型
										var price = list[i].price;// 价格
										var title = list[i].title;// 标题
										var fileName = list[i].myFiles[0].name;// 标题
										//var date = list[i].date;// 发布时间
										var startDate = list[i].startDate;// 活动开始时间
										var address = list[i].address;// 地址
										var joinUserNum = list[i].joinUserNum;// 参加人数int
										var joinUserlength = list[i].joinUser.length;
										
										
										var surplusNum = Number(joinUserNum)-Number(joinUserlength);//剩余票数
										
										var newstartDate = startDate.substring(10,
												5).replace("-", "月")
												+ '日';// 报名开放日期
									
										var newstartDateSSS = startDate.slice(11);
		
										
										$('#bus-list').append('      <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left am_list_li">   <div class="am-u-sm-3 am-list-thumb am_list_thumb">  <a href="busOne?id='+id+'" class="">   <img src="'+articlePath+'//'+fileName+'" class="am_news_list_img" alt=""    />   </a>  </div>  <div class=" am-u-sm-9 am-list-main am_list_main">      <h3 class="am-list-item-hd am_list_title">   <a href="busOne?id='+id+'" class="">'+title+' &nbsp;<nobr style="font-weight: bold;color: #9E9E9E">('+price+'￥)</nobr></a>    </h3>   <div class="am_list_author"><span class="am_list_author_ico"></span><span class="name"></span></a><span class="am_news_time"><time class="timeago" > </time></span></div>	<div class="am-list-item-text " >  	   	接车地点：'+address+'    </div>     <div class="pet_hd_block_tag"><span>余 '+surplusNum+' 张</span> '+newstartDate+newstartDateSSS+'</div>  </div>    </li>');
									}
							
								},
								error : function() {
								}
							});

				})

// 获取当前时间方法
function CurentTime() {
	var now = new Date();
	var year = now.getFullYear(); // 年
	var month = now.getMonth() + 1; // 月
	var day = now.getDate(); // 日
	var hh = now.getHours(); // 时
	var mm = now.getMinutes(); // 分
	var clock = year + "-";
	if (month < 10)
		clock += "0";
	clock += month + "-";
	if (day < 10)
		clock += "0";
	clock += day + " ";
	if (hh < 10)
		clock += "0";
	clock += hh + ":";
	if (mm < 10)
		clock += '0';
	clock += mm;
	return (clock);
}
